"""
@author: wangzhongren
@file: 平均年龄.py
@time: 2023/12/7 9:18
"""
import pandas as pd

# 读取Excel文件
file_path = 'your_file_path.xlsx'  # 请替换为你的文件路径
data = pd.read_excel(file_path, engine='openpyxl')

# 确保数据被正确读取，打印头部信息查看
print(data.head())

# 计算平均年龄
average_age = data['年龄'].mean()
print(f'平均年龄是: {average_age}')